package psnl.bingo.mr.demo1;

import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.io.WritableComparator;

// Mapper输出数据的分组器
public class D1MapOutGroup extends WritableComparator {
    public D1MapOutGroup() {
        super(D1Line.class, true);
    }

    @Override
    public int compare(WritableComparable a, WritableComparable b) {
        D1Line aa = (D1Line) a;
        D1Line bb = (D1Line) b;
        return aa.groupKey().compareTo(bb.groupKey());
    }
}
